<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="/template/_template.xhtml">
      <ui:define name="conteudo">
		<h:form>
			<h:messages/>
     	<h:dataTable  value="#{cursoBean.lista}" var="curso" rules="rows" cellpadding="5">
     	<f:facet name="caption">
     	A listagem a seguir exibe a relação de todos os cursos do sistema.
     	</f:facet>
     	<f:facet name="header">Listagem de Cursos</f:facet>
     	<f:facet name="footer">Final da Listagem de Cursos</f:facet>
     	<h:column>
     	<f:facet name="header">Nome</f:facet>
     	#{curso.nome}
     	</h:column>
     	<h:column>
     	<h:commandLink action="#{cursoBean.editar}">
     	<h:graphicImage library="img" name="editar.png" style="border:0"/>
     	<f:setPropertyActionListener target="#{cursoBean.curso}" value="#{curso}"/>
     	</h:commandLink>
     	</h:column>
     	<h:column>
     	<h:commandLink action="#{cursoBean.excluir}" onclick="if(!confirm('Confirma a exclusão do curso: #{curso.nome}?')) return false;">
     	<h:graphicImage library="img" name="excluir.png" style="border:0"/>
     	<f:setPropertyActionListener target="#{cursoBean.curso}" value="#{curso}"/>
     	</h:commandLink>
     	</h:column>
     	</h:dataTable>
		</h:form>
	 </ui:define>
     </ui:composition>
</html>